/**
 * @author hotab
 */
(function($) {
	$.fn.fillCommentList = function(tableId, url, idfilms) {
		var arr = [];
		arr.push({name: 'idfilms', value: idfilms});
		$.post(url, arr, function(retData, status) {
			var i = 0;
			var glob = '';
			var str = '';
			for (var indx in retData){
				for (var key in retData[indx]){
					var value = retData[indx][key];
					str = str.concat('<td>'+value+'</td>');
					i++;
					if (i == 3) {
						glob = glob.concat('<tr>'+str+'</tr>');
						i = 0;
						str = '';
					}
				}
			}
			$('#'+tableId).append('<tbody id="tmp">'+glob+'</tbody>');
		});
	}
})(jQuery);